import {
  clone,
  pull,
  install,
  build,
  deploy,
  rewind,
  gitlog,
} from "src/controllers/operate";

export default function (router: Router, callback: Function) {
  // 克隆
  router.post("/operate/clone", callback(clone));

  // 拉取
  router.post("/operate/pull", callback(pull));

  // 安装
  router.post("/operate/install", callback(install));

  // 构建
  router.post("/operate/build", callback(build));

  // 部署
  router.post("/operate/deploy", callback(deploy));

  // 回滚
  router.post("/operate/rewind", callback(rewind));

  // git日志
  router.get("/operate/gitlog", callback(gitlog));
}
